# 
# album_base_controller.rb
# 
# Created on 2007-10-15, 7:41:07
# 
# To change this template, choose Tools | Templates
# and open the template in the editor.
 

class Base::AlbumBaseController<ApplicationController
  
  #查看相片
  def view_photo
    @photo=Photo.find(params[:id])
    comments_pagination(@photo.id)
    @album=@photo.album
    @comment=Comment.new
    @recent_comments=Comment.recent('PHOTO')
    @sidebar_type=:photo_view
  end
  
  def list_comments
    comments_pagination(params[:photo_id])
    @photo=Photo.find(params[:photo_id])
    @sidebar_type=:photo_view
  end
    
  #评论分页
  def comments_pagination(photo_id)
    @comments=Comment.paginate_by('photo', photo_id, params[:page])
  end
  
end
